#pragma once

#include <process.h>
#include "TinyConfig.h"
#include "TinyTCPServer.h"
#include "TinyMsg.h"
#include "TinyCC_Define.h"
//#include "tinydbmanager.h"

using namespace TinyCC::msg;

class CTinyModule
{
public:
	CTinyModule(void);
public:
	virtual ~CTinyModule(void);
public:
	bool start();
	bool end();
    void reciveMsgFunc( void* param);
public:
	CTinyConfig* m_config;
	TinyCC::TCP::CTinyTCPServer m_TCPServer;
	TinyCC::CTinyThread * m_pThread;
private:
	//Build event array
	HANDLE pEvent[ 2 ];
public:
	virtual bool init(void) = 0;
	virtual void ProcessReceivedMsg(CTinyMsg& inMsg,CTinyMsg& OutMsg)=0;
public:
	bool m_bExit;
};
